$(document).ready(function(){
	
	//register account
	$("#register-acount-button-id").click(function(event){
		
		registerMyAcountToSchool();
	});
	
});

	//Method to register account
	function registerMyAcountToSchool(){

			//Create the ajax call
			$.ajax({
				type: 'POST',
				url: 'register/registerAccount.htm',
				data: $("#register-account-form-id").serialize(),
				timeout: 5000,
				success: function(data) {
				 if (data) {
					$('#registeraccount-message-div').html( data.message);
				 }	},
				error: function (XMLHttpRequest, textStatus, errorThrown) {
						$('#registeraccount-message-div').html("Error registerting account to myschool.Error:"+errorThrown+"<br/>Please refresh the web page ");
				},
				dataType: 'json'
			});
	}
